package cn.zbowen.mybatis.mapstruct;

import cn.zbowen.mybatis.dto.TaxTypeCodeDto;
import cn.zbowen.mybatis.entity.TaxTypeCode;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.ReportingPolicy;

@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE)
public interface TaxTypeCodeMapper {

    @Mapping(source = "createTime", target = "formattedDate", dateFormat = "yyyy-MM-dd HH:mm:ss")
    TaxTypeCodeDto toDto(TaxTypeCode entity);

    @Mapping(source = "formattedDate", target = "createTime", dateFormat = "yyyy-MM-dd HH:mm:ss")
    TaxTypeCode toEntity(TaxTypeCodeDto dto);

}
